package cn.example.demo.modules.house.service;

import cn.example.demo.modules.house.dto.HousingOrderDto;
import cn.example.demo.modules.house.entity.HousingOrder;
import cn.example.demo.common.model.service.ServiceResult;
import cn.example.demo.common.retrieval.PageBean;

import java.util.List;
import java.util.Map;

/**
 * 描述：【租房订单】服务接口
 */
public interface IHousingOrderService {
    /**
     * 新增【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    ServiceResult insertHousingOrder(HousingOrderDto housingOrderDto);

    /**
     * 更新【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    ServiceResult updateHousingOrder(HousingOrderDto housingOrderDto);

    /**
     * 查询【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    PageBean queryHousingOrder(HousingOrderDto housingOrderDto);

    /**
     * 查询个人【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    PageBean queryOwnedHousingOrder(HousingOrderDto housingOrderDto);

    /**
     * 删除【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    ServiceResult deleteHousingOrder(HousingOrderDto housingOrderDto);

    /**
     * 根据 ID 查询【租房订单】
     *
     * @param id
     */
    HousingOrder findHousingOrderById(String id);

    /**
     * 以字典表格式查询【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    List<Map<String, Object>> queryHousingOrderAsDict(HousingOrderDto housingOrderDto);

    /**
     * 批量更新【房源】状态
     *
     * @param houseDto
     * @return
     */
    ServiceResult batchUpdateStatus(HousingOrderDto houseDto);

    /**
     * 查询【租房订单】关联用户信息
     *
     * @param housingOrderDto
     * @return
     */
    PageBean queryHousingOrderWithUserInfo(HousingOrderDto housingOrderDto);

    /**
     * 信息数据统计
     */
    ServiceResult dataStatistic();

    /**
     * 定时刷新订单状态，在 yml 配置 cron
     */
    void refreshOrderStatus();

    /**
     * 邮件通知
     */
    /**
     * 邮件通知
     *
     * @param orderId 订单ID
     */
    void mailAdvice(String orderId);

    /**
     * 续房【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    ServiceResult continueHousing(HousingOrderDto housingOrderDto);

    /**
     * 退房【租房订单】
     *
     * @param housingOrderDto
     * @return
     */
    ServiceResult finishHousing(HousingOrderDto housingOrderDto);
}
